package com.wnxy.sk.product.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.wnxy.sk.common.result.Result;
import com.wnxy.sk.product.entity.Comment;
import com.wnxy.sk.product.entity.ProductCover;
import com.wnxy.sk.product.entity.ProductDetail;
import com.wnxy.sk.product.mapper.CommentMapper;
import com.wnxy.sk.product.service.ICommentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * <p>
 * 商品评论表 服务实现类
 * </p>
 *
 * @author Jet
 * @since 2022-10-11
 */
@Service
public class CommentServiceImpl extends ServiceImpl<CommentMapper, Comment> implements ICommentService {

    @Override
    public List<Comment> findByProductId(Integer productId) {
        return baseMapper.selectList(
                Wrappers.lambdaQuery(Comment.class)
                        .eq(Comment::getProductId,productId));
    }
}
